<!doctype html>
<html lang="zh-cn">

<head>
<title>注册</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="js/jquery-3.4.1.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<style>
.c1{
border-radius:20px;
}
</style>
</head>

<body style="background-image:url(img/car1.jpg);background-size:100%">
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">

<form action="LandServlet" method="post" onsubmit="return check()" class="form-horizontal" style="margin-top:70px">

  <div class="form-group">
    <label for="inputEmail3" class="col-sm-3 control-label" style="color:white">个人名称</label>
    <div class="col-sm-9">
      <input type="text" class="form-control" id="inputEmail3" style="width:80%" name="username" placeholder="请输入您的名称">
     <p id="tip1" style="color:red"></p>
	</div>
  </div>
  
  
  <div class="form-group">
    <label for="inputPassword3" style="color:white" class="col-sm-3 control-label">注册密码</label>
    <div class="col-sm-9">
      <input type="password" class="form-control" id="inputPassword3" style="width:80%" name="pwd" placeholder="请输入您的密码" >
    <p id="tip2" style="color:red"></p>  
    </div>
  </div>
  
  <div class="form-group">
    <label for="inputPassword4" class="col-sm-3 control-label" style="color:white">确认密码</label>
    <div class="col-sm-9">
      <input type="password" class="form-control" id="inputPassword4" style="width:80%" name="repwd" placeholder="请确认您的密码" >
<p id="tip3" style="color:red"></p>  
  </div>
  </div>
  

  <div class="form-group">
    <label for="inputEmail4" style="color:white" class="col-sm-3 control-label" >证件住址</label>
    <div class="col-sm-9">
      <input type="text" class="form-control" id="inputEmail4" style="width:80%" name="address" placeholder="请输入您的地址">
     <p id="tip4" style="color:red"></p>
     <p id="tip5" style="color:red"></p>
	</div>
  </div>

  
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        <label>
          <input type="checkbox" > <span style="color:white">我已阅读并同意相关条款</span>
        </label>
      </div>
    </div>
  </div>
  <div class="form-group">
    <div class="col-sm-offset-5 col-sm-7">
      <button type="submit" class="btn btn-default btn-danger c1" >立即注册</button>
    </div>
  </div>
</form>

</div>
<div class="col-md-4"></div>
</div>

</body>

<script>
function loseFocus(){
alert("失去焦点")
}





function check(){
    // DOM   input获取或者设置值得时候的一律使用value
	// 除了input标签，都使用innerHTML
    inputUserTag1 = document.getElementById("inputEmail3")
	inputPwdTag1 = document.getElementById("inputPassword3")
	inputPwdTag2 = document.getElementById("inputPassword4")
    inputUserTag2 = document.getElementById("inputEmail4")
	
	spanTip1 = document.getElementById("tip1")
	spanTip2 = document.getElementById("tip2")
	spanTip3 = document.getElementById("tip3")
	spanTip4 = document.getElementById("tip4")
	
	
	//alert(123)
	if(inputUserTag1.value == ''){
	    spanTip1.innerHTML = "用户名不能为空"
	    // 结束方法
		return false
	}
	
	if(inputPwdTag1.value == ''){
	    spanTip2.innerHTML = "密码不能为空"
		return false
	}

	if(inputPwdTag2.value == ''){
	    spanTip3.innerHTML = "密码不能为空"
		return false
	}
	if(inputPwdTag2.value != inputPwdTag1.value ){
	    spanTip3.innerHTML = "密码不匹配"
		return false
	}
	if(inputUserTag2.value==''){
		spanTip4.innerHTML = "地址不能为空"
	return false
	}

	return true
	
	

}








</script>


</html>